<template>
	<div id="page">
		<div class="logo">
			<svg class="icon" aria-hidden="true">
				<use xlink:href="#icon-shizizuo"></use>
			</svg>
		</div>
		<div class="phone">
			<div class="phone-number" >
				<el-input class="el-input"  
				type="text" placeholder="请输入电话号码"
				v-model="username"/>
				<el-input class="el-input"  
				type="password" 
				placeholder="请输入密码"
				v-model="password"
				@keydown.enter="loginHandle" />
				<!-- <div class="switch">
					<i class="el-icon-sort" ></i>
				</div> -->
			</div>
			<div class="tip">中国移动提供认证服务</div>
		</div>
		<div @click="loginHandle" class="loginbtn">
			<div>登录</div>
			<!-- <div class="tip">推荐</div> -->
		</div>
		<div class="privacy">
			<input type="checkbox" class="checkbox">
			<span>同意</span>
			<span>服务条款、隐私策略</span>
		</div>
		<div class="icons">
			<svg class="icon" aria-hidden="true">
				<use xlink:href="#icon-QQ"></use>
			</svg>
			<svg class="icon" aria-hidden="true">
				<use xlink:href="#icon-weixin"></use>
			</svg>
		</div>
	</div>
</template>

<script>
export default {
	name:'name',
	data() {
		return {
			username:'',
			password:'',
		}
	},
	methods: {
		loginHandle() {
			this.$api.login({
				phone: encodeURIComponent(this.username),
				password:encodeURIComponent(this.password),
			}).then(res => {
				console.log(res)
				this.$router.push({
					path:`/userinfo/${res.account.id}`
				})
			})
		},
	},
}
</script>

<style lang="less" scoped>
#page {
	position:absolute;
	width: 100vw;
	top: 0;
	bottom: 0;
	left: 0; 
	right: 0;
	background-color: #121212;
	display: flex;
	flex-direction: column;
	align-items: center;
	.logo {
		background-color: #545454;
		border-radius: 6em;
		margin-top: 160px;
		.icon {
			height: 6em;
			width: 6em;
			color: #1FDF64;
		}
	}
	.phone {
		display: flex;
		flex-direction: column;
		margin-top: 14*12px;
		color: white;
		font-size: 1.5em;
		justify-content: center;
		align-items: center;
		.phone-number {
			display: flex;
			flex-direction: column;
			.el-input {
				display: block;
				margin:5px 0;
			}
			.switch {
				position: absolute;
				float: right;
				right: 20%;
				top: 53.5%;
			.el-icon-sort {
				color: #c1c1c162;
				font-size: 16px;
				background-color: #DD4A3D;
				border: 6px solid #DD4A3D;
				border-radius: 100%;
				transform: rotate(90deg);
				}
			}
		}
		.tip {
			margin-top: 5px;
			font-size: 12px;
			color: #b4b4b4b7;
			letter-spacing: 3px;
		}
	}
	.loginbtn {
		width: 300px;
		height: 50px;
		border-radius: 25px;
		font-size: 1.3em;
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		align-items: center;
		background-color: white;
		margin-top: 20px;
		div {
			color: #DB2D1E;
		}
		.tip {
			// position: absolute;
			display: inline-block;
			font-size: 0.5em;
			text-align: center;
			margin-left: 10px;
			text-align: center;
			padding: 1px 3px;
			border: 1px solid #DB2D1E;
			border-radius: 24px;
		}
	}
	.privacy {
		margin-top: 30px;
		input {
			// vertical-align: 用于input框和文本的对齐
			vertical-align:middle;
			position: relative;
			left: -1%;
			top: -5%;
		}
		span:nth-child(2) {
			color: #d3d1d1b7;
			font-size: 1em;
			margin: 0 5px;
		}
		span:nth-child(3) {
			color: rgb(215, 215, 215);
		}
	}
	.icons {
		margin-top: 60px;
		display: flex;
		justify-content: space-between;
		.icon {
			font-size: 2em;
			background-color: white;
			// border: 1em solid white;
			border-radius: 3em;
			margin: 0 10px;
		}
	}
}
</style>>